rlpr can be used anywhere a traditional lpr might be used, and is backwards compatible with traditional BSD lpr.
rlpr can be installed and used in two different ways:
1. Ideally, if the rlpr client can be installed setuid root, then rlpr can interact directly with other lpd's on the network. See examples below.
2. If rlpr cannot be installed setuid root (in cases where one is not the administrator on the machine one needs to print from) then rlpr can be used in conjunction with an rlprd proxy agent. See the configuring a proxy and examples sections below for details.
This is especially annoying in scenarios where there is a central UNIX server which many users (using their own desktop computers) connect to in order to do their daily work; If those users wish to print files from the central server to their personal machines (assuming they had a local lpd), they cannot do this without the central server's /etc/printcap being edited to contain the host and printer of each user on the network - this scales horribly.
-Hhost select the host to print to (used with -P). -Pprinter select the printer to print to (used with -H). -Xproxy select the proxy host to use. -V print version and exit.note: setting up the environment can be automated with environment variables and/or each user's personal .rlprrc file. See rlprrc(5) for details.
-#copies print copies copies of each document - use sparingly, printers aren't copiers. -m send mail upon completion. -r remove file after printing. -s ignored (provided for compatibility). -q quiet mode - don't print to stdout. -W "Windows" mode - for printing multiple files to a windows-based lpd.
-1 print data using troff(1) R (times roman) font. -2 print data using troff(1) I (times italic) font. -3 print data using troff(1) B (times bold) font. -4 print data using troff(1) S (special) font. -c assume data has been produced by cifplot(1). -d assume data has been produced by tex(1). -f filter data assuming the start of each line has a fortran carriage control character. -g assume data has been produced by the BSD standard plot library. -l treat control characters as regular characters. -n assume data has been produced by ditroff. -o assume data is postscript. -p print data using pr(1). -t assume data has been produced by troff(1). -v assume the data contains a raster image.
-i[cols] indent output by cols columns (8 by default). -h do not print burst (banner) page. -wwidth use width for page width when using pr(1). -Cclass use class for class name on burst page instead of the local system name. -Jjob use job for jobname on burst page instead of the first filename in the job. -Ttitle use title for titlename when using pr(1) instead of current filename. -Uuser use user for username on burst page instead of the actual username.
If you or someone you know has root access to a machine on the network, you can use a proxy, known as rlprd to get around this architectural wart.
rlprd works by taking lpd requests on a non-privileged port, mapping them to a privileged port, and sending them out to the real lpd. The proxy and the lpd need not be on the same machine.
In the scenario provided in the motivation, if each user had root access on his own machine, it would be optimal for the user to start rlprd up on his own machine, in which case the proxy and the printhost are the same machine. The user would additionally have to make sure his own machine was listed in his local /etc/hosts.lpd so that his lpd would accept connections from his rlprd.
However, if the machine the user wants to print to is not running unix (but is running an lpd) (i.e. Windows, WinNT, etc) -- Then that user can configure his lpd to accept connections from an rlprd running somewhere on the network, and use that rlprd as a proxy for rlpr.
For more on this mess, see rlprd(8).
sun% rlpr -Hfoo.bar.org -Php4l foo.c
prints foo.c to the printer hp4l on the host foo.bar.org (assuming foo.bar.org has been configured to accept print requests from host sun in its /etc/hosts.lpd).
sun% who | rlpr -Hfoo.bar.org -Php4l
prints the output of who(1) to the printer hp4l on the host foo.bar.org.
sun% rlpr -Xfoo.bar.org -Hfoo.bar.org -Php4l foo.c
prints foo.c to the printer hp4l on the host foo.bar.org using foo.bar.org as a proxyhost. Under this configuration, foo.bar.org needs to be configured to accept print requests from the proxy (itself) and not from sun. In situations where the proxy and the printhost are not the same machine, this can lead to some security holes due to the original lameness of berkeley lpd's host-based security.
note: if a proxyhost isn't set anywhere it is assumed one is not required in your configuration.
$HOME/.rlprrc Printer/Host database /tmp/cf* Temporary control files on local machine /tmp/df* Temporary data file for jobs from stdin /var/spool/*/cf* Temporary control files on printhost /var/spool/*/df* Temporary data files on printhost /etc/hosts.lpd Host-based security on printhost /etc/passwd Personal identification